package evolution.stop;

import evolution.algorithm.Iterative;

public class IterationStopCondition implements StopCondition<Iterative> {

	private int parameter;

	public IterationStopCondition() {
	}

	public IterationStopCondition(int iterationsLimit) {
		this.parameter = iterationsLimit;
	}

	@Override
	public boolean shouldStop(Iterative algorithm) {
		return algorithm.getCurrentIteration() >= parameter;
	}

	@Override
	public int getParameter() {
		return parameter;
	}

	@Override
	public void setParameter(int parameter) {
		this.parameter = parameter;
	}
}
